﻿package com.hlkj.baidu_push;

import net.sf.json.JSONObject;

public class BaiduPushUtil {
	private static final String API_KEY = "3VOb7EHHrsQmkt5GwoGtfZxf";//正式
	private static final String SECRIT_KEY = "Sq8aeiNmZg5f1sArWrSdEgnuprhEbTG7";//正式
	
	
	/**
	 * 推送消息
	 * 
	 * @param message
	 * @author dongct [2013-6-28 上午11:00:51]
	 */
	public static void pushMessage(Message message) {
		BaiduPush baiduPush = new BaiduPush(BaiduPush.HTTP_METHOD_POST,
				SECRIT_KEY, API_KEY);
		JSONObject jsonObject = JSONObject.fromObject(message);
		baiduPush.PushMess(jsonObject.toString());
	}

	/**
	 * 推送百度消息 区分是否所有手机端都接收消息
	 * @param message
	 */
//	public static void pushMessage(BaiduMessage message) {
//
//		BaiduPush baiduPush = new BaiduPush(BaiduPush.HTTP_METHOD_POST,
//				SECRIT_KEY, API_KEY);
//		JSONObject jsonObject = JSONObject.fromObject(message);
//		baiduPush.PushMess(jsonObject.toString());
//	}

}
